import { createSSRApp } from 'vue';
import * as Pinia from 'pinia';
import uviewPlus from '@/uni_modules/uview-plus';
import App from './App.vue';
// @ts-ignore
import zConfig from '@/uni_modules/z-paging/components/z-paging/js/z-paging-config';
//
// @ts-ignore
zConfig.setConfig({
  'default-page-size': '20',
  'empty-view-text': '空空如也~~',
  'refresher-end-bounce-enabled': false,
  'hide-no-more-inside': true,
  'safe-area-inset-bottom': true,
  'use-safe-area-placeholder': true,
  // 'show-refresher-when-reload': true,
});

export function createApp() {
  const app = createSSRApp(App);
  app.use(Pinia.createPinia());
  app.use(uviewPlus);

  uni.$u.config.unit = 'rpx';

  return {
    app,
    Pinia,
  };
}
